package com.young.servicecmn.controller;

import com.young.commonutil.result.Result;
import com.young.model.model.cmn.Dict;
import com.young.servicecmn.service.DictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/cmn")
public class DictController {
    @Autowired
    private DictService dictService;

    @ApiOperation(value = "获取字典树")
    @GetMapping("/getTree")
    public Result getTree() {
        List<Dict> dictTree = dictService.getTree();
        return Result.ok(dictTree);
    }
}
